﻿using Microsoft.AspNetCore.Mvc.Rendering;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WXWorkSvc.Common.TagHelpers;

public class NoShowTagHelper : TagHelper
{
    private readonly IHtmlGenerator _HtmlGenerator;
    [HtmlAttributeNotBound]
    [ViewContext]
    public ViewContext ViewContext { get; set; } = default!;
    /// <summary>
    /// like "/Pages/Menu.cshtml"
    /// </summary>
    public string AspViewPath { get; set; } = "/Pages/Menu.cshtml";

    public NoShowTagHelper(IHtmlGenerator generator, IHtmlHelper htmlHelper)
    {

        _HtmlGenerator = generator;
    }
    public override void Process(TagHelperContext context, TagHelperOutput output)
    {
        output.TagName = "";
        if (ViewContext.View.Path.Equals(AspViewPath, StringComparison.OrdinalIgnoreCase))
            output.SuppressOutput();
        //else
        //    base.Process(context, output);
    }
}
